package com.qf.fileupload.filter;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import java.io.IOException;

@Slf4j
public class DemoFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        log.debug("HelloFilter init");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        log.debug("进入HelloFilter");
        filterChain.doFilter(servletRequest,servletResponse);  // 放行当前请求，交给后续的 servlet继续处理

    }

    @Override
    public void destroy() {
        log.debug("HelloFilter destroy");
    }
}
